The present invention relates to data processing by digital computer, and more particularly to event handling.
In the model-view-controller (MVC) design pattern used for developing software applications, the model represents the core of an application. The model can have multiple views, where each view displays information about the model to a user. A controller of the model receives events—for example, from a user through a user interface—to manipulate the model. The model and the controller typically include application code. When changes occur in the model, the model updates all of its views. Data binding is used for decoupling controller and view with regards to data flow. For example, a table view can be defined to display data of a corresponding table that is stored in the model or controller. The table is used as data source for the table view (data binding). The table view can be replaced by a different view, such as a link list, that binds against the same table. In this case the new view displays the table data without changing anything in the controller or the model. When the table view initiates an event (e.g., “onClick”), the event is processed by the controller. Typically, the controller includes an event handler that expects a specific signature (e.g., a specific list of parameters), such as “onClick(tableViewCell)”, for a given event. However, when the table view is replaced by the link list view, the signature of the event is likely to change. For example, a different parameter may be passed to controller (e.g., “onClick(LinkListltem)”). Without further modification the controller may not be able to process the event that is initiated by the link list view of the event handler.